{block name="title" prepend}{if $mode == "defense"}{$LNG.lm_defenses}{else}{$LNG.lm_shipshard}{/if}{/block}
{block name="content"}
{if !$NotBuilding}<table width="70%" id="infobox" style="border: 2px solid red; text-align:center;background:transparent"><tr><td>{$LNG.bd_building_shipyard}</td></tr></table><br><br>{/if}
{if !empty($BuildList)}
<table style="width:760px">
	<tr>
		<td class="transparent">
			<div id="bx" class="z"></div>
			<br>
			<form action="game.php?page=shipyard&amp;mode={$mode}" method="post">
			<input type="hidden" name="action" value="delete">
			<table>
			<tr>
				<th>&nbsp;</th>
			</tr>
			<tr>
				<td><select name="auftr[]" id="auftr" size="10" multiple><option>&nbsp;</option></select><br><br>{$LNG.bd_cancel_warning}<br><input type="submit" value="{$LNG.bd_cancel_send}"></td>
			</tr>
			<tr>
				<th>&nbsp;</th>
			</tr>
			</table>
			</form>
			<br><span id="timeleft"></span><br><br>
		</td>
	</tr>
</table>
<br>
{/if}
<form action="game.php?page=shipyard&amp;mode={$mode}" method="post">
<table style="width:760px">
{$td=3}
	{foreach $elementList as $ID => $Element}
 {if $td==3}
            <tr>
                <td width="260px">
             {$td=0}
         {else} 
         	<td width="260px">
         {/if}      
            {$td= $td +1}
	<table class="b_box">
      <tr>
		<td rowspan="2" style="width:75px;">
			<a href="#" onclick="return Dialog.info({$ID})">
				<img src="{$dpath}gebaeude/{$ID}.gif" alt="{$LNG.tech.{$ID}}" width="75" height="75">
			</a>
		</td>
		<td>
			<a href="#" onclick="return Dialog.info({$ID})">{$LNG.tech.{$ID}}</a><span id="val_{$ID}"><br />{if $Element.available != 0} ({$LNG.bd_available} {$Element.available|number}){/if}</span>
		</td>
	</tr>
	<tr style="padding:0;">
		<td>
			<div style="width:100%; text-align: left;">
                <span style="display:block; clear:both; text-align: center">
                    Время: {$Element.elementTime|time}
                </span>
          		<span style="clear:both; display:block;">
                    {if $Element.AlreadyBuild}<span style="color:red">{$LNG.bd_protection_shield_only_one}</span>{elseif $NotBuilding && $Element.buyable}
                    <input type="text" name="fmenge[{$ID}]" id="input_{$ID}" style="width:90px" size="{$maxlength}" maxlength="{$maxlength}" value="0" tabindex="{$smarty.foreach.FleetList.iteration}">
					<input type="button" value="{$LNG.bd_max_ships}" onclick="$('#input_{$ID}').val('{$Element.maxBuildable}')">
                    {/if}
                </span>
         	</div>
		</td>
	</tr>
	<tr>
		<td colspan="2" style="margin-bottom:10px;">  
			<table style="width:100%">
				<tr>
					
                        {foreach $Element.costRessources as $RessID => $RessAmount}
                        <td class="transparent">                       
                            <img src="{$dpath}images/{$RessID}.gif" alt="{$LNG.tech.{$RessID}}" height="25" /><br />
                                <span style="font-weight:bold; color:{if $Element.costOverflow[$RessID] == 0}lime{else}red{/if}">
                                   	{$RessAmount|number}
                                </span>
						</td>
                        {/foreach}
				</tr>
			</table>
        </td>
      </tr>
    </table>
    {if $td==3}
        </td>
    </tr>
    {else} 
        </td>
    {/if} 
	{/foreach}
    {if $td!=3}
    </tr>
    {/if}
	{if $NotBuilding}<tr><th colspan="3" style="text-align:center"><input type="submit" value="{$LNG.bd_build_ships}"></th></tr>{/if}
    <tr>
    	<td class="transparent" style="text-align:left" colspan="3">
        	<a href="game.php?page=shipyard&amp;mode=inter">Классический вид</a> <br /> Мгновенная покупка за Темную материю <a href="game.php?page=dmfleet">[Флота]</a> - <a href="game.php?page=dmdeff">[Обороны]</a>
        </td>
    </tr>
</table>
</form>
<script type="text/javascript">
data			= {$BuildList|json};
bd_operating	= '{$LNG.bd_operating}';
bd_available	= '{$LNG.bd_available}';
</script>
{/block}